ACCENT_SETTING = {};

ACCENT_SETTING.__INIT__ = function () {
    ACCENT_SETTING.user_info();
};
ACCENT_SETTING.jump = function () {
    var context = ACCENT_SETTING.data;
    mainView.router.load({
        url: "src/my_center/accent_setting/accent_setting.html",
        context: context
    });
}

ACCENT_SETTING.user_info = function () {
    var url = url_('api/V1/user_info');
    var data = {};
    var success = function (d) {
        if (d.code == 0) {
            ACCENT_SETTING.data = d.data;
            ACCENT_SETTING.jump();
        } else if (d.code == 1011) {
            my_tips_(d.msg, function () {
                go_("login")
            });
        } else {
            my_tips_(d.msg);
        }
    }
    request_(url, data, success)
}
ACCENT_SETTING.logout = function () {
    var url = url_('index/User/logout');
    var data = {
        "logout_by_app": 1
    };
    var success = function (d) {
        if (d.code == 1011) {
            my_tips_(d.msg, function () {
                go_("login")
            });
        } else {
            my_tips_(d.msg);
        }
    }
    request_(url, data, success)
}
